/**
 * 设置每个工作日的对应的时间段
 */
Ext.namespace("Ext.ux.workholiday");
 
Ext.ux.workholiday.WorkDaySetPanel = Ext.extend(Ext.ux.Wiz.Card, {

 	wizardWin: null,
 	monitorValid: true, 
	labelAlign: 'right',
	labelWidth: 180,
	
	workDays: null,
	initComponent: function(){
		Ext.ux.workholiday.WorkDaySetPanel.superclass.initComponent.call(this);
		
		var items = [{
			xtype: 'fieldset',
			title: '请选择每周的工作日',
			layout: 'form',
			items:[{
				xtype: 'checkboxgroup',
	            columns: 3,
	            hideLabel: true,
	            items: [
	                {boxLabel: '星期日', name: 'Sunday'},
	                {boxLabel: '星期一', name: 'Monday', checked: true},
	                {boxLabel: '星期二', name: 'Tuesday', checked: true},
	                {boxLabel: '星期三', name: 'Wednesday', checked: true},
	                {boxLabel: '星期四', name: 'Thursday', checked: true},
	                {boxLabel: '星期五', name: 'Friday', checked: true},
	                {boxLabel: '星期六', name: 'Saturday'}
	            ]
            }]
		}];   
	
		this.add(items);
	},
	calSelWorkDays: function(){
		var workDaysSelStr = this.getForm().getValues(true);
		var workDaysSel = workDaysSelStr.split('&');
		var workDays = new Array();
		for(var i = 0; i < workDaysSel.length; i++){
			var workDay = workDaysSel[i].split("=")[0];
			workDays.push(workDay);
		}
		this.workDays = workDays;
	},
	getWorkDays: function(){
		return this.workDays;
	}
	
 });